﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace Sinacor.Infra.UI.Controls.SmartClient.DataGrid
{
    public class DataGridCellsPresenter : Microsoft.Windows.Controls.Primitives.DataGridCellsPresenter
    {
        protected override bool IsItemItsOwnContainerOverride(object item)
        {
            return item is DataGridCell;
        }

        protected override DependencyObject GetContainerForItemOverride()
        {
            return new DataGridCell();
        }

        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            base.PrepareContainerForItemOverride(element, item);

            DataGridCell cell = (DataGridCell)element;
            cell.ApplyStyle();
        }
    }
}
